package 设计模式.memento;

/**
 * @功能
 * @创建时间 2020/5/4
 */
public class Emp {
    private String name;
    private int age;
    private double salary;

    public EmpMemento empMemento(){
        return new EmpMemento(this);
    }
    public void recover(EmpMemento e){
        this.name = e.getName();
        this.age = e.getAge();
        this.salary = e.getSalary();
    }
    public Emp(String name, int age, double salary) {
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}
